import React, { Component } from 'react';
// import Header from './components/Header'
import Tab from './components/Tab'
import './App.css'
import { getTabs } from './api'
class App extends Component {
  state = {
    tabs: []
  }
  render() {
    const { tabs } = this.state
    return (
      <div className="app">
        {/* <Header></Header> */}
        <Tab list={ tabs }></Tab>
      </div>
    );
  }
  componentDidMount() {
    this.getTabsAndSet()
  }
  async getTabsAndSet() {
    const resp = await getTabs()
    const { data } = resp.data
    this.setState({
      tabs: data
    })
    console.log(data);
  }
}

export default App;
